home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / freqb.lha / freqb.rexx < prev   
OS/2 REXX Batch file  |  1994-11-26  |  2KB  |  78 lines

  1. /* Build a FREQ file by Larry Cloud M3001 */
  2.  
  3. start1:
  4. cls=" "
  5. say cls||"FREQ Builder by Larry Cloud M3001"
  6. say "Enter address (4D) separated by spaces, example: 1 350 31 0"
  7. say "Or hit Q to abort."
  8. if zone ~="ZONE" then do
  9.  say "Or hit enter for "||zone||" "||net||" "||node||" "||point||"."
  10. end
  11. pull adr
  12. if adr="" & zone ~="ZONE" then signal start2
  13. if upper(adr)="Q" then signal getout
  14. parse var adr zone net node point junk
  15. if zone < 1 then signal start
  16. if net="" | node="" then signal start1
  17. if point="" then point="0"
  18. if exists("ram:nodeinfo") then do
  19.  address command "delete ram:nodeinfo quiet"
  20.  do i=1 to 1000;end
  21. end
  22. address command "findnode "||zone||":"||net||"/"||node||"."||point||" > ram:nodeinfo"
  23. do i=1 to 1000;end
  24. open(file,"ram:nodeinfo",'r')
  25. do i=1 to 5
  26. x=readln(file)
  27. end
  28. x=readln(file)
  29. if x~=" Data not found." then do
  30.  do i=1 to 4
  31.   x=readln(file)
  32.   say x
  33.  end
  34.  call close(file)
  35.  signal start2
  36. end
  37. call close(file)
  38. say "That address is invalid.  Please try again."
  39. zone="ZONE"
  40. signal start1
  41.  
  42.  
  43. start2:
  44. say "Enter filename to FREQ (or hit ENTER to abort)"
  45. pull filename
  46. if filename="" then signal start5
  47.  
  48. start3:
  49. say "Enter password (or hit ENTER for NO password)"
  50. password=""
  51. pull password
  52.  
  53. start4:
  54. op="W"
  55. adrs=zone||"."||net||"."||node||"."||point||".REQ"
  56. if exists("OUT:"||adrs) then op="A"
  57. string="Creating new "
  58. if op="A" then string="Appending to "
  59. say string||"REQ file "||adrs
  60. if password ~="" then filename=filename||" "||password
  61. open(file,"OUT:"||adrs,op)
  62. writeln(file,filename)
  63. close(file)
  64.  
  65. start5:
  66. say "Again? (Y/n)"
  67. pull question
  68. if upper(question)="N" then signal getout
  69. signal start1
  70.  
  71. getout:
  72. say "You've been using FREQ Builder by Larry Cloud M3001"
  73. if exists("ram:nodeinfo") then do
  74.  address command "delete ram:nodeinfo quiet"
  75.  do i=1 to 1000;end
  76. end
  77. exit
  78.